"""每个活动的开始时间，结束时间如下，保证最多的活动，贪心最早结束的"""


actives = [(1,4),(3,5),(0,6),(5,7),(3,9),(5,9),(6,10),(8,11),(8,12),(2,14),(12,16)]



def active_choice(actives):
    res = [actives[0]]
    for i in range(1,len(actives)):
        if actives[i][0] >= res[-1][1]:
            res.append(actives[i])

    return res


print(active_choice(actives))